import { CHECK_FIELDS, CHECK_FIELDS_MAP } from "@/constants/check";

export const findCheckFields = (fieldsName: string, checkType?: number) => {
  const res = CHECK_FIELDS.find((item) => item.value === fieldsName);
  let exactRes = undefined;
  if (checkType && Array.isArray(CHECK_FIELDS_MAP[checkType])) {
    exactRes = CHECK_FIELDS_MAP[checkType].find(
      (item: any) => item.value === fieldsName
    );
  }
  return exactRes || res;
};
